package com.pth.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.Notice;
import com.pth.service.NoticeService;
import com.pth.utils.timeUtil;

@SuppressWarnings("serial")
public class NoticeAllAction extends ActionSupport {

	private int id;
	
	private NoticeService noticeService;
	
	private Notice notice;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public NoticeService getNoticeService() {
		return noticeService;
	}

	public void setNoticeService(NoticeService noticeService) {
		this.noticeService = noticeService;
	}

	public Notice getNotice() {
		return notice;
	}

	public void setNotice(Notice notice) {
		this.notice = notice;
	}
	
	
	public String delete() throws Exception{
		
		Notice n=noticeService.getNoticeByid(id);
		
		noticeService.delete(n);
		
		return "delete";
		
	}
	
	public String modify() throws Exception{
		
		
		notice.setNpublishtime(timeUtil.getCurrentDate());
		noticeService.modify(notice);
		return "modify";
	}
	
	
}
